package net.service.Impl;

import net.mapper.CategoryMapper;
import net.mapper.ProductMapper;
import net.pojo.Category;
import net.pojo.Product;
import net.pojo.ProductJo;
import net.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author admin
 * @Date 2019/4/3 14:40
 */

@Service
@Transactional
public class CatgoryServiceImpl implements CategoryService {
    @Autowired
    CategoryMapper categoryMapper;
    @Autowired
    ProductMapper productMapper;
    @Override
    public List<Category> findAll() {
        return categoryMapper.findAll();
    }

    @Override
    public List<Category> findById(int cid) {
        return categoryMapper.findByCid(cid);
    }

    @Override
        public Category findByCid(Integer cid) {
        return categoryMapper.findById(cid);
    }
}
